package org.example.judge.service;

import com.baomidou.mybatisplus.extension.service.IService;
import lombok.NonNull;
import org.example.judge.oj.JudgeResult;
import org.example.judge_common.entity.PageResult;
import org.example.judge_common.entity.RequestSubmitParams;
import org.example.judge_common.rank.AllUserRank;
import org.example.judge_pojo.Submit;

import java.util.List;

public interface SubmitService extends IService<Submit> {

    PageResult<Submit> search(RequestSubmitParams params);

    /**
     * 题目的所有提交数
     * @param problemId
     * @return
     */
    Integer getSumByProblem(String problemId);

    /**
     * 题目提交通过的人数
     * @param problemId
     * @return
     */
    Integer getAccessSumByProblem(String problemId);

    Integer getSuccessProblemSum(String userId,boolean pass);
    /**
     *
     * @param problemId
     * @param userId
     * @param errorStatus 状态 -> JudgeResult.*
     * @return
     */
    Integer getSumbitSum(String problemId, String userId, Integer errorStatus);

    Submit lastSubmit(String problemId, String userId);
    PageResult<AllUserRank> getAllUserRankSubmit(Integer page,Integer size,String beginTIme);

    List<String> getNoAcceept(String userId);
}
